 /** 
 * Copyright (c) 2012 bowen Information Technology Co., Ltd. All Rights Reserved. 
 * <p>
 * Project Name:  
 * FileName：g.beny.framework.exception.web.WebErrors.java 
 * Created On: 2012-7-28 下午9:10:02
 * Description: 
 * @author LiWenbo
 * @version 1.0
 * <p>
 * Modifier： 2012-7-28 下午9:10:02
 * Modify Time： 2012-7-28 下午9:10:02
 */      
package g.beny.framework.exception.web;

import java.util.ArrayList;
import java.util.List;

import javax.servlet.http.HttpServletRequest;

/**
 * @ClassName: WebErrors
 * @Description: 界面提示信息和常用错误校验
 * @author LiWenbo
 * @date 2012-7-28 下午9:10:02
 * 
 */
public class WebResponse {

	/* TODO 
	private int responseCode;
	
	 TODO 
	private String responseKey;
	
	 TODO 
	private List<String> responseMsgs;
	
	*//**
	 * 构造函数
	 *//*
	public WebResponse() {
		super();
		responseMsgs = new ArrayList<String>();
	}

	*//**
	 * @return the responseCode
	 *//*
	public int getResponseCode() {
		return responseCode;
	}

	*//**
	 * @param responseCode the responseCode to set
	 *//*
	public void setResponseCode(int responseCode) {
		this.responseCode = responseCode;
	}

	*//**
	 * @return the responseKey
	 *//*
	public String getResponseKey() {
		return responseKey;
	}

	*//**
	 * @param responseKey the responseKey to set
	 *//*
	public void setResponseKey(String responseKey) {
		this.responseKey = responseKey;
	}

	*//**
	 * @return the List<String> responseMsgs
	 *//*
	public List<String> getResponseMsgs() {
		return responseMsgs;
	}

	*//**
	 * @param List<String> responseMsgs the responseMsgs to set
	 *//*
	public void setResponseMsgs(List<String> responseMsgs) {
		this.responseMsgs = responseMsgs;
	}
	
	
	*//**
	 * methodName: addCode
	 * Description:添加响应代码
	 * Created On: 2012-7-28 下午11:44:48
	 * @author LiWenbo
	 * <p>
	 * @param responseCode
	 * @param responseKey
	 * @param responseMsgs 
	 *//*
	public void addCode(int responseCode, String responseKey, String responseMsgs) {
		this.responseMsgs.add(responseMsgs);
	}
	
	
	*//**
	 * methodName: getMsgByResponseKey
	 * Description:根据KEY 获取 国际化
	 * Created On: 2012-7-29 上午1:12:36
	 * @author LiWenbo
	 * <p>
	 * @param key
	 * @param paramsName
	 * @return 
	 *//*
	public String getMsgByResponseKey(String key,String paramsName) {
		return null;
	};
	
	*//**
	 * methodName: createInstance
	 * Description:创建实例
	 * Created On: 2012-7-29 上午12:15:30
	 * @author LiWenbo
	 * <p>
	 * @return 
	 *//*
	public WebResponse createInstance() {
		return new WebResponse();
	}
	
	*//**
	 * methodName: validate
	 * Description:校验前台
	 * Created On: 2012-7-29 上午1:09:56
	 * @author LiWenbo
	 * <p>
	 * @param regExp
	 * @param paramsName
	 * @param responseKey
	 * @param request
	 * @return 
	 *//*
	public WebResponse validate(String regExp, String paramsName, String responseKey, HttpServletRequest request) {
		String paramsValue = request.getParameter(paramsName);
		if(!MatchesUtil.validate(regExp, paramsValue)) {
			this.addCode(ResponseConstant.ResponseCode.CODE_601.VALUE(), responseKey, getMsgByResponseKey(responseKey, paramsName));
		}
		return this;
	}
	
	
	*//**
	 * methodName: validate
	 * Description:校验前台
	 * Created On: 2012-7-29 上午1:10:29
	 * @author LiWenbo
	 * <p>
	 * @param regExp
	 * @param paramsName
	 * @param responseKey
	 * @param responseMsg
	 * @param request
	 * @return 
	 *//*
	public WebResponse validate(String regExp, String paramsName, String responseKey,String responseMsg, HttpServletRequest request) {
		String paramsValue = request.getParameter(paramsName);
		if(!MatchesUtil.validate(regExp, paramsValue)) {
			this.addCode(ResponseConstant.ResponseCode.CODE_601.VALUE(), responseKey, responseMsg);
		}
		return this;
	}*/
}
